#ifndef _CONNECTION_OPTIONS_
#define _CONNECTION_OPTIONS_

#include <string>
#include <node.h>
#include <node_object_wrap.h>

using namespace std;
using namespace node;
using namespace v8;

namespace freedatabase
{
	class ConnectionOptions : public ObjectWrap
	{
	public:
		static void Init(v8::Local<v8::Object> exports);
		string GetHost() const { return _host; }
		long GetPort() const { return _port; }
		string GetUsername() const { return _username; }
		string GetPassword() const { return _password; }
		string GetDbName() const { return _dbname; }

	public:
		static void SetHost(const FunctionCallbackInfo<Value> &args);
		static void SetPort(const FunctionCallbackInfo<Value> &args);
		static void SetUsername(const FunctionCallbackInfo<Value> &args);
		static void SetPassword(const FunctionCallbackInfo<Value> &args);
		static void SetDbName(const FunctionCallbackInfo<Value> &args);

	private:
		explicit ConnectionOptions();
		~ConnectionOptions();

		static void New(const FunctionCallbackInfo<Value> &args);
		static Persistent<Function> constructor;

	private:
		string _host;
		string _dbname;
		string _username;
		string _password;
		long _port;
	};
}

#endif // !_CONNECTION_OPTIONS_
